﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataSync.Model;

namespace DataSync.BLL
{
    /// <summary>
    /// 全量同步数据表
    /// </summary>
    public enum FullSyncTables
    {
        Accounts = 2,
        Card_Accounts = 7,
    };

    /// <summary>
    /// 按日期增量同步数据表
    /// </summary>
    public enum DateIncrementSyncTable
    {
        Transaction = 1,
        Account_Op_Logs = 2,
        Account_Month = 101,
    };

    public class ConcreteCreator : Creator
    {
        /// <summary>
        /// 创建全量同步数据表对象
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public override SyncBase CreateFullSyncTable(int index)
        {
            switch (index)
            {
                case 2:
                    return new Accounts();
                case 7:
                    return new CardAccounts();
                default:
                    return null;
            }
        }

        /// <summary>
        /// 创建按日期增量同步数据表对象
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public override SyncBase CreateDateIncrementSyncTable(int index)
        {
            switch (index)
            {
                case 1:
                    return new TTransaction();
                case 2:
                    return new AccountOpLogs();
                case 101:
                    return new AccountMonth();
                default:
                    return null;
            };
        }
    }
}
